<template>
	
<view class="">
	<view class="content_cksl">
		<view class="content_num">
			{{total}}
		</view>
		<view class="">
			库存总量
		</view>
	</view>
	<view class="odo">
		
	
	<view class="odo_list" v-for="(item,index) in odo_list " :key="index">
									<view class="odo_center">
										
										<view class="odo_centerLeft">
											<img src="/static/default_goods_img.png" alt="">
										</view>
										<view class="odo_centerRight">
											<view class="">
												货品名称：{{item.hp_name}}
											</view>
											<view class="">
												货品编号：{{item.hp_code}}
											</view>
											<view class="">
												货品颜色：{{item.hp_color}}
											</view>
											<view class="">
												货品尺码：{{item.hp_size}}
											</view>
											<view class="">
												入库数量：{{item.hp_num}}
											</view>
										</view>
									</view>
									<view class="odo_bottom">
										<view class="odo_bottomLeft">
											开单人：{{item.supplier_name}}
										</view> 
										<view class="odo_bottomRight">
											上架时间:{{item.hp_sj_time}}
										</view>
									</view>
	</view>
	</view>
</view>
			
		
</template>

<script>
	export default {
		data() {
			return {
				items: ['今日', '昨日', '近7天','近30天'],
				current: 0,
				activeColor: '#fccc04',
				odo_list:[
					
				],
			}
		},
		created() {
			uni.request({
				url:"http://localhost:3000/rk_information",
				success: (res) => {
					this.odo_list = res.data.data
				}
			})
		},
		onLoad() {
			uni.getSystemInfo({
				success: (res) => {
					res.screenHeight
					this.phone_height = (res.screenHeight * (750/res.windowWidth))
				}
			})
			
		},
		methods:{
		
		},
		
		computed:{
			total: function(){
				var a = parseInt("0")
				for (var i = 0; i < this.odo_list.length ; i++) {
				 a = a + parseInt(this.odo_list[i].hp_num)
			}
			return a
			}
			// nowDate:function(){
			// 	var oldDate = new Date();
			// 	var date = {
			// 	    year: oldDate.getFullYear(),
			// 	    month: oldDate.getMonth() + 1,
			// 	    date: oldDate.getDate(),
			// 	};      
			// 	var newmonth = date.month > 10 ? date.month : "0" + date.month;
			// 	var newday = date.date > 10 ? date.date : "0" + date.date;
			// 	this.nowDate = date.year + "-" + date.month + "-" + date.date 
			// },
		}
		
	}
</script>

<style>
	.content_cksl{
			background-color: #fff;
			width: 100%;
			height: 150rpx;
			font-size: 40rpx;
			margin-top: 20rpx;
			text-align: center;
			line-height: 40rpx;
	}
	.content_num{
			color: red;
			font-weight: bold;
			line-height: 90rpx;
	}
	.odo{
			background-color: white;
			margin: auto;
			margin-top: 20rpx;
			position: relative;
			width: 94%;
	}
	.odo_list{
		height: 400rpx;
	}
	.odo_center{
		height: 300rpx;
		border-bottom: 5rpx dotted #eee;
		width: 90%;
		margin: auto;
		padding: 20rpx 0;
		box-sizing: border-box;
		/* float: left; */
	}
	.odo_centerLeft{
/* 		width: 160rpx;
		height: 160rpx; */
		float: left;
	}
	.odo_centerLeft img{
		width: 200rpx;
		height: 200rpx;
		border-radius: 10rpx;
		margin-top: 40rpx;
	}
	.odo_centerRight{
		float: left;
		line-height: 50rpx;
		margin-left: 20rpx;
		font-size: 35rpx;
		color: #494848;
		padding-top: 10rpx;
	}
	.odo_bottom{
		display: flex;
		width: 90%;
		margin: auto;
		line-height: 100rpx;
		font-size: 30rpx;
	}
	.odo_bottomLeft{
		flex: 1;
		text-align: left;
	}
	.odo_bottomRight{
		flex:1;
		text-align: center;
	}
</style>